from base import Base
from selenium.webdriver.common.by import By
from time import  sleep

class XueXiPage(Base):
    fangdajing = (By.XPATH,'//android.widget.ImageView[@resource-id="cn.xuexi.android:id/img_search_left"]')
    ershida = (By.XPATH,'//android.widget.TextView[@text="二十大报告"]')
    dy = (By.XPATH,'//android.view.View[@text="全部"]')


    def sousuoyewu(self):
        self.find_ele(self.fangdajing).click()
        sleep(3)
        self.find_ele(self.ershida).click()
        sleep(3)

    sanhanggang = (By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.FrameLayout[2]/android.widget.FrameLayout[1]/androidx.viewpager.widget.ViewPager/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.ImageView')
    yaowen = (By.XPATH,'//android.widget.TextView[@text="要闻"]')
    dy_toutiao = (By.XPATH,'//android.widget.TextView[@text="头条"]')
    def yaowenyewu(self):
        self.find_ele(self.sanhanggang).click()
        sleep(2)
        self.find_ele(self.yaowen).click()
        sleep(3)